
package net.atremmedia.gwt.actionjava.examples.sgi;

import actionjava.display.TextField;

public class HighlightBlock
{
	private double x;
	private double y;
	private SGI2RegHeader stage;
	private HighlightVO highlight;

	public HighlightBlock(double x, double y, SGI2RegHeader stage, String color, String title, HighlightVO highlight)
	{
		this.x = x;
		this.y = y;
		this.stage = stage;
		this.highlight = highlight;
		initialize();
	}

	private void initialize()
	{
		TextField hightlightHeader = new TextField(highlight.getTitle(), "Arial", highlight.getColor());
		hightlightHeader.setSize(17);
		hightlightHeader.setX(x);
		hightlightHeader.setY(y);
		stage.addChild(hightlightHeader);

		HighlightLinkVO[] links = highlight.getLinks();
		for(int i = 0;i < links.length;i++) {
			HighlightLinkVO link = links[i];
			new HighlightButton(x, y + (i * 20) + 30, highlight.getColor(), stage, link);
		}
	}
}
